//Kyle Marshall
//Assignment 3
//marshaky@onid.oregonstate.edu
//cs362

#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>

//testing the  getEmbargo function in dominion.c
int main (int argc, char** argv) {
  struct gameState G;
  int k[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse, 
           sea_hag, tribute, smithy};
  int seed = 1000;
  int returnCheck;

  memset(&G, 23, sizeof(struct gameState)); 
  
  initializeGame(2, k, seed, &G);

  /*Test to make sure that the coins are incremented by 2,
  emargoTokens increment by 1, and function returns -1 if
  supplyCount is -1 with each call.
  */

  printf("initial coins value %d\n",G.coins);
  printf("initial embargo Tokens value %d\n",G.embargoTokens[0]);
  getEmbargo(0,1,&G);
  printf("after call coins value %d\n",G.coins);
  printf("after call embargo Tokens value %d\n",G.embargoTokens[0]);
  assert(G.coins == 6);
  assert(G.embargoTokens[0] == 1);

  //check for invalid input
  G.supplyCount[0] = -1;
  returnCheck = getEmbargo(0,1,&G);
  assert(returnCheck == -1);
  printf("All Tests Passed\n");
return 0;
}